package com.example.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.pojo.repairBookPojo;
import com.example.pojo.repairTestingPojo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * ClassName:repairTesting
 * Description:
 *
 * @Author 赵永峰
 * @Create 2024/5/15 9:49
 * @Version 1.0
 */
@Mapper
public interface repairTestingMapp {

    //添加一个新的检测项目，添加的项目只有车间信息
    @DS("baodingRussia")
    void addNew(String workshopEnglish, String taksNameEnglish, LocalDateTime updateTime, LocalDateTime establishTime);
    //用两个字段，符合这两个字段的查询出所有的数据
    @DS("baodingRussia")
    @Select("select * FROM repairTesting where ${firstField}=#{firstFieldValue} and ${secondField}=#{secondFieldValue}")
    List<repairTestingPojo> byTowAll(String firstField, String secondField, String firstFieldValue, String secondFieldValue);

    /*
     * 查询,根据ID，查询某一个字段的值
     * */
    @DS("baodingRussia")
    @Select("select ${fieldName} from repairTesting where id = #{id}")
    String lookUpId(Integer id,String fieldName);

    //对表只写入文件名称的接口
    @DS("baodingRussia")
    @Select("update repairTesting set fileNameAll=#{fileNameAll} where id=#{id}")
    void updateOnlyFileName(repairTestingPojo tableDataTemp);
    //添加数据，但是不添加图片路径信息
    @DS("baodingRussia")
    void UpdateNoFileList(repairTestingPojo repairTestingPojo);
}
